/*UR+dS5jSr8CsJCizbF2yPB75IOcf1ETrAT8v2M62QBpBqeetQ0pk8Wi6vT6xHBRH*/
/*
 * @Author: xiahui 
 * @PageInfo: 变更 
 * @Date: 2019-01-21 09:37:36 
 * @Last Modified by: zhangmi
 * @Last Modified time: 2021-09-10 12:09:10
 */
import { ajax } from 'nc-lightapp-front';
import { URL, UISTATUS, FIELDS, PAGECODE } from '../../constance';
import { showWarningInfo } from '../../../../../scmpub/scmpub/pub/tool/messageUtil';
import { getLangByResId } from '../../../../../scmpub/scmpub/pub/tool/multiLangUtil';

export default function(props, record, index) {
	if (!record[FIELDS.bshowlatest].value) {
		showWarningInfo(null, getLangByResId(this, '4004PURDAILY-000022')); /* 国际化处理： 合同不是最新版本，不允许变更*/
	}

	let pk = record[FIELDS.pk_ct_pu].value;
	//增加数据权限校验
	ajax({
		url: URL.edit,
		data: pk,
		success: (res) => {
			if (res.success) {
				props.pushTo(URL.card, { status: UISTATUS.modify, id: pk, pagecode: PAGECODE.cardPagecode });
			}
		}
	});
}

/*UR+dS5jSr8CsJCizbF2yPB75IOcf1ETrAT8v2M62QBpBqeetQ0pk8Wi6vT6xHBRH*/